// 
// $Rev:: 22            $:  Revision of last commit
// $Author:: rvhaverm@g#$:  Author of last commit
// $Date:: 2010-07-25 1#$:  Date of last commit
// 
package agents.messages;

import agents.agents.MobileServiceAgent;
import agents.agents.Receptionist;
import agents.interfaces.IMessage;

import com.ibm.aglet.AgletProxy;
import com.ibm.aglet.Message;

public class AddActionMessage extends BaseMessage
{
    private IMessage _message;
    private String _host;
    
    public AddActionMessage()
    {	
    }
    
    public void setMessage(Message msg)
    {
	super.setMessage(msg);
	
	_message = (IMessage) getMessage().getArg("message");
	_host = (String) getMessage().getArg("dispatchHost");
    }
    
    
    public AddActionMessage(IMessage message, String dispatchHost)
    {
	_message = message;
	_host = dispatchHost;
	getMessage().setArg("message", _message);
	getMessage().setArg("dispatchHost",_host);
    }

   
    @Override
    public void sentTo(MobileServiceAgent agent)
    {
	agent.addAction(_message, _host);
    }

}
